﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Skynet.LibraryModule.Presenter.ListAudit;
using Microsoft.Practices.Unity;

namespace SkynetSite.Audit
{
    public partial class ListAudit : Infrastructure.Web.Views.Page,   Skynet.LibraryModule.Presenter.ListAudit.IListAuditView
    {
         private ListAuditPresenter _Presenter;
        [Dependency]
        public ListAuditPresenter Presenter
        {
            get { return _Presenter; }
            set
            {
                _Presenter = value;
                _Presenter.View = this;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                this.Presenter.OnViewInitialized();
            }
            this.Presenter.OnViewLoaded();
        }

        public IEnumerable<Infrastructure.CloudWeb.Entities.MethodAudit> Audits
        {
            set
            {
                this.gvAudits.DataSource = value;
                this.gvAudits.DataBind();
            }
        }
    }
}